# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Integrations.V1.Model.GoogleInternalCloudCrmEventbusV3PostToQueueWithTriggerIdRequest do
  @moduledoc """
  LINT.IfChange Use this request to post all workflows associated with a given trigger id. Next available id: 13

  ## Attributes

  *   `clientId` (*type:* `String.t`, *default:* `nil`) - Optional. If the client id is provided, then the combination of trigger id and client id is matched across all the workflows. If the client id is not provided, then workflows with matching trigger id are executed for each client id in the {@link TriggerConfig}. For Api Trigger, the client id is required and will be validated against the allowed clients.
  *   `ignoreErrorIfNoActiveWorkflow` (*type:* `boolean()`, *default:* `nil`) - Optional. Flag to determine whether clients would suppress a warning when no ACTIVE workflows are not found. If this flag is set to be true, an error will not be thrown if the requested trigger_id or client_id is not found in any ACTIVE workflow. Otherwise, the error is always thrown. The flag is set to be false by default.
  *   `parameters` (*type:* `GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoEventParameters.t`, *default:* `nil`) - Passed in as parameters to each workflow execution. Optional.
  *   `priority` (*type:* `String.t`, *default:* `nil`) - The request priority this request should be processed at. For internal users:
  *   `quotaRetryCount` (*type:* `integer()`, *default:* `nil`) - Optional. This is a field to see the quota retry count for integration execution
  *   `requestId` (*type:* `String.t`, *default:* `nil`) - Optional. This is used to de-dup incoming request: if the duplicate request was detected, the response from the previous execution is returned. Must have no more than 36 characters and contain only alphanumeric characters and hyphens.
  *   `resourceName` (*type:* `String.t`, *default:* `nil`) - This field is only required when using Admin Access. The resource name of target, or the parent resource name. For example: "projects/*/locations/*/integrations/*"
  *   `scheduledTime` (*type:* `String.t`, *default:* `nil`) - Optional. Time in milliseconds since epoch when the given event would be scheduled.
  *   `testMode` (*type:* `boolean()`, *default:* `nil`) - Optional. Sets test mode in {@link enterprise/crm/eventbus/event_message.proto}.
  *   `triggerId` (*type:* `String.t`, *default:* `nil`) - Matched against all {@link TriggerConfig}s across all workflows. i.e. TriggerConfig.trigger_id.equals(trigger_id) Required.
  *   `userGeneratedExecutionId` (*type:* `String.t`, *default:* `nil`) - This is a unique id provided by the method caller. If provided this will be used as the execution_id when a new execution info is created. This is a string representation of a UUID. Must have no more than 36 characters and contain only alphanumeric characters and hyphens.
  *   `workflowName` (*type:* `String.t`, *default:* `nil`) - Optional. If provided, the workflow_name is used to filter all the matched workflows having same trigger_id+client_id. A combination of trigger_id, client_id and workflow_name identifies a unique workflow.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :clientId => String.t() | nil,
          :ignoreErrorIfNoActiveWorkflow => boolean() | nil,
          :parameters =>
            GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoEventParameters.t() | nil,
          :priority => String.t() | nil,
          :quotaRetryCount => integer() | nil,
          :requestId => String.t() | nil,
          :resourceName => String.t() | nil,
          :scheduledTime => String.t() | nil,
          :testMode => boolean() | nil,
          :triggerId => String.t() | nil,
          :userGeneratedExecutionId => String.t() | nil,
          :workflowName => String.t() | nil
        }

  field(:clientId)
  field(:ignoreErrorIfNoActiveWorkflow)

  field(:parameters, as: GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoEventParameters)

  field(:priority)
  field(:quotaRetryCount)
  field(:requestId)
  field(:resourceName)
  field(:scheduledTime)
  field(:testMode)
  field(:triggerId)
  field(:userGeneratedExecutionId)
  field(:workflowName)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.Integrations.V1.Model.GoogleInternalCloudCrmEventbusV3PostToQueueWithTriggerIdRequest do
  def decode(value, options) do
    GoogleApi.Integrations.V1.Model.GoogleInternalCloudCrmEventbusV3PostToQueueWithTriggerIdRequest.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.Integrations.V1.Model.GoogleInternalCloudCrmEventbusV3PostToQueueWithTriggerIdRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
